<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link href="../../app/bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
</head>
<body ng-controller="AppController">
<button class="btn btn-default" ng-click="click();">bib</button>
<abc name="{{xx}}"></abc>

<script src="../../app/bower_components/jquery/dist/jquery.js"></script>
<script src="../../app/bower_components/angular/angular.js"></script>

<script>
    var app = angular.module('app', []);
    app.controller('AppController', function ($scope) {
        $scope.xx = 'yy';
        $scope.click = function () {
            $scope.xx = 'zz';
        }
    });
    app.directive('abc', function () {
        return {
            restrict: 'ACE',
            scope: {},
            link: function (scope, element, attrs) {
                attrs.$observe('name', function (value) {
                    console.log(value);
                });
            }
        }
    });

</script>
</body>
</html>